home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1991 June
/
64er_Magazin_91-06_1991_Markt__Technik_de.d64
/
speech finde.src
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
5KB
|
126 lines
1 open4,4
10 sys36864
20 .opt p4
24 ;
25 ; ------ startadresse -----
27 ;
30 *= 2142
31 ;
32 ; **** speech-finder v1.0 ****
33 ;
34 ; von nikolaus heusler
35 ; zwengauerweg 18
36 ; 8000 muenchen 71
37 ;
38 ; (c) 64'er, markt & technik 1991
39 ;
40 ; ------- variablen -------
42 ;
45 mem =2;zeiger in speicher
50 bts =4;anzahl der bits
55 ojoy =254;alter joystick-wert
60 ric =5;laufrichtung
70 v =1277;bildschirm-position
80 tmp =166;zwischenspeicher
90 tem =6;tempo
95 vol =54296;sid-lautstaerke
98 ;
100 ; ------- programm --------
102 ;
104 ; --- initialisieren
1000 jsr 65409;videochip initialisieren
1002 lda #<hi:ldy #>hi:jsr $ab1e;strout bildschirmtext ausgeben
1004 lda #0:sta ric;vorwaerts:sta mem:sta mem+1;speicherzeiger:ldx #24
1006 csid sta 54272,x;sid loeschen:dex:bpl csid
1007 lda #9:sta tem;starttempo = 9:lda #2:sta bts;aufloesung anfangs 2 bit
1008 jsr par;parameter am schirm ausgeben
1010 ; --- hauptschleife
1100 pump sei;interrupt aus:lda #48:sta 1;ram einblenden:lda mem+1:sta v+240
1102 ldy #0:lda (mem),y;ein byte aus speicher holen:sta tmp;und merken
1104 lda #55:sta 1:cli;und rom wiederherstellen
1106 ldx bts;anzahl der bits:bne no1;nicht ein bit
1108 ; --- 1 bit
1110 ldy #7;acht werte
1112 b1l lda tmp:asl:adc #0:sta tmp;register linksverschieben
1114 and #1;unterstes bit ist datenbit:beq n1l:lda #15;lautstaerke 15
1116 n1l jsr tb;lautstaerke an sid melden und pause
1118 dey;naechstes bit:bpl b1l:bmi rdy;fertig
1130 no1 dex;zwei bit:bne no2;nein, dann vier bit
1132 ; --- 2 bit
1134 ldy #3;vier werte
1136 b2l lda tmp:asl:adc #0:asl:adc #0:sta tmp;register zweimal linksverschieben
1138 and #3;datenbits sind bits 0 und 1:tax:lda tab2,x;wert aus tabelle lesen
1140 jsr tb;und an sid melden und warten
1142 dey;weitere bits:bpl b2l:bmi rdy;nein dann fertig
1150 no2 =*
1152 ; --- 4 bit
1154 ldy #1;zwei werte
1156 b4l lda tmp:asl:adc #0:asl:adc #0:asl:adc #0:asl
1157 adc #0;register viermal linksverschieben
1158 and #15;datenbits im unteren nibble:jsr tb;an sid melden, pause
1160 dey;noch einen wert:bpl b4l
1162 ; --- ein byte abgerabeitet
1170 rdy lda ric;laufrichtung:bne rew;nicht null, dann rueckwaerts
1171 ; --- vorwaerts
1172 inc mem;zeiger auf naechste zelle richten:bne next:inc mem+1;high:jmp next
1173 ; --- rueckwaerts
1174 rew lda mem:bne r1:dec mem+1;zeiger auf vorherige speicherzelle richten
1176 r1 dec mem;= um eins erniedrigen
1177 ; --- naechstes byte bearbeiten, joystick abfragen
1178 next lda 56320;joystick lesen:and #31:cmp ojoy:beq k5:sta ojoy;entprellen
1180 lda 56320:and #1;oben:bne k1
1181 ; --- anzahl bits veraendern
1182 ldx bts:inx:cpx #3:bcc j1:ldx #0
1184 j1 stx bts:jsr par;parameter ausgeben
1186 k1 lda 56320:and #2;unten:bne k2
1187 ; --- laufrichtung umdrehen
1188 lda ric:eor #1;invertieren:sta ric:jsr par;parameter anzeigen
1190 k2 lda 56320:and #4;links:bne k3
1191 ; --- tempo veraendern
1192 ldx tem:dex:bpl j3:ldx #9;maximalwert
1194 j3 stx tem;neues tempo:jsr par;parameter ausgeben
1200 k3 lda 56320:and #8;rechts:bne k4:lda #0:sta vol;stumm:jmp 65409;fertig
1202 k4 lda 56320:and #16;feuer:beq x5;ja, dann hexanzeige
1204 k5 jmp pump;sonst weiter in hauptschleife
1205 ; --- adresse hexadezimal einblenden
1206 x5 lda #12:sta 214;cursorzeile:lda #16:sta 211;cursorspalte
1207 jsr 58732;cursor an neue stelle:lda #"$":jsr 65490;dollarzeichen drucken
1208 lda mem+1;adresse high:jsr hex;ausgeben:lda mem;und lowbyte:jsr hex;auch
1210 ldx #0:ldy #0;verzoegerung, ca. 1 sekunde
1212 pse dex:bne pse;um stick zu entprellen:dey:bne pse
1214 f1 lda 56320:and #16;wenn feuerknopf immer noch gedrueckt:beq f1;warten
1216 f2 lda 56320:and #16;feuer:bne f1;warten, bis feuer gedrueckt
1220 lda #16:sta 211;cursor auf spalte 16:ldx #4;fuenf leerzeichen
1222 spl jsr $ab3f;space drucken:dex;und anzeige:bpl spl;loeschen:jmp pump
1690 ;
1699 ; --- zahl hexadezimal ausdrucken
1700 hex pha:lsr:lsr:lsr:lsr;erst high-nibble drucken:jsr hex1:pla;low-nibble
1702 hex1 and #15;signifikante bits isolieren:tax;als tabellen-index
1704 lda hext,x;hexwert aus tabelle:jmp 65490;ausdrucken
1790 ;
1792 ; --- sid-lautstaerke setzen und pause
1800 tb sta vol;wert an sid melden
1802 ldx tem;tempo:beq fert;null, dann keine pause
1804 wait nop:nop;verzoegerung:nop:nop:nop:nop:dex:bpl wait
1806 fert rts
1890 ;
1892 ; --- parameter am bildschirm ausgeben
1900 par ldx bts;anzahl bits:lda bitt,x:sta v;in video-ram
1902 ldx ric:lda rict,x:sta v+80;richtung
1904 lda #"9":sec:sbc tem:sta v+160;neun minus tempo:rts
1997 ;
1998 ; ------ diverse texte ----
1999 ;
2000 hi .asc "speech-finder v1":.byt 13
2001 .asc "[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]
2002 .byt 13,13:.[198] "von nikolaus heusler, 01.91
2004 .byt 13:.asc " anz. bits: [160]
2006 .byt 13:.[198] " richtung: close
2008 .byt 13:.asc " tempo: [160]
2010 .byt 13:.[198] " speicher: close
2020 .byt 13:.asc "bedienung: joystick port 2":brk
2100 hext .asc "0123456789abcdef
2102 bitt .[198] "124
2104 rict .asc "
2200 tab2 .byt 15,10,5,0